package ru.vba.kitchen.model

class User {
	public enum Role{
		USER,ADMIN
	}
	public enum SocialNetwork {
		NONE,VK,FB,OK,MAIL,GOOGLE,YA,TWI
	}
	String name
	String login
	String email
	String hash
	SocialNetwork socialNetwork
	Date dateCreated
	Date lastActivity
	Picture picture
	static hasMany = [receipts : Receipt, tags : Tag, followers : User]
	static constraints = {
		email(email:true, unique:true)
		login(size:3..32, unique:true)
		name()
		hash(nullable:true)
		socialNetwork(nullable:true)
		lastActivity(nullable:true)
		picture(nullable : true)
	}
	@Override
	public String toString() {
		return name;
	}
}
